package cn.gailvlun.gll.net.emotion;

import com.google.gson.Gson;
import com.google.gson.annotations.SerializedName;

import cn.gailvlun.gll.net.base.Profile;


public class EmotionTag {

    private int id;
    private String title;
    private String icon;
    @SerializedName("emotion_type")
    private String emotionType;
    private Profile owner;
    private String created;
    private int top;
    @SerializedName("emo_count")
    private int emotionCount;
    private boolean isUserCreated;

    public static EmotionTag objectFromData(String str) {

        return new Gson().fromJson(str, EmotionTag.class);
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getIcon() {
        return icon;
    }

    public void setIcon(String icon) {
        this.icon = icon;
    }

    public EmotionEnum getEmotionType() {
        for (EmotionEnum state : EmotionEnum.values()) {
            if (state.name().equals(emotionType)) {
                return EmotionEnum.valueOf(emotionType);
            }

        }
        return null;
    }

    public void setEmotionType(EmotionEnum emotionType) {
        this.emotionType = emotionType.name();
    }


    public String getCreated() {
        return created;
    }

    public void setCreated(String created) {
        this.created = created;
    }

    public int getTop() {
        return top;
    }

    public void setTop(int top) {
        this.top = top;
    }

    public int getEmotionCount() {
        return emotionCount;
    }

    public void setEmotionCount(int emotionCount) {
        this.emotionCount = emotionCount;
    }

    public boolean isUserCreated() {
        return isUserCreated;
    }

    public void setUserCreated(boolean userCreated) {
        isUserCreated = userCreated;
    }

    public Profile getOwner() {
        return owner;
    }

    public void setOwner(Profile owner) {
        this.owner = owner;
    }
}
